package utility.webmailclient.app.usermanagement.delegate;

import org.springframework.dao.DataAccessException;

import utility.webmailclient.app.usermanagement.model.RegistrationFormObject;
import utility.webmailclient.app.usermanagement.persistance.dao.UserProfileDAO;

public class UserProfileManagerImpl implements UserProfileManager{

	private UserProfileDAO userProfileDAO;

	public UserProfileDAO getUserProfileDAO() {
		return userProfileDAO;
	}

	public void setUserProfileDAO(UserProfileDAO userProfileDAO) {
		this.userProfileDAO = userProfileDAO;
	}

	@Override
	public void registerUser(RegistrationFormObject registrationFormObject) throws Exception{
		// TODO Auto-generated method stub
		try{
		this.userProfileDAO.crateUser(registrationFormObject.getUserName());
		}catch (DataAccessException e) {
			// TODO: handle exception 
			/**
			 * log the DATAException and thrown registration failure message
			 */
			e.printStackTrace();
			
		}
	}

	
	
}
